package exercise1;
import java.util.Scanner;
public class No3_1 {
    public static void main(String []args)
    {
        Scanner input=new Scanner(System.in);
        System.out.println("Enter a: ");
        int a=input.nextInt();
        System.out.println("Enter b: ");
        int b=input.nextInt();
        System.out.println("Enter c: ");
        int c=input.nextInt();

        if ((Math.pow(b,2)-4*a*c)<0)
        {
            System.out.println("The equation has no real root");
        }
        else if ((Math.pow(b,2)-4*a*c)==0)
        {
            double result=(-1*b)/(2*a);
            System.out.println("x is "+result);
        }
        else
        {
            double x1=((-1*b)+Math.sqrt(Math.pow(b,2)-4*a*c))/(2*a);
            double x2=((-1*b)-Math.sqrt(Math.pow(b,2)-4*a*c))/(2*a);
            System.out.println("x1 is "+x1+" x2 is "+x2);
        }
    }
}
